<!-- <template>
  <div class="child">
    <h2>child---{{ msg }}</h2>
    <button @click="$emit('click', '子组件的数据')">setData</button>
  </div>
</template>
<script>
export default {
  // props: ['msg'],
  props: {
    msg: {
      type: String,
      default: '默认值'
    }
  },
  data() {
    return {}
  },
  setup(props) {
    console.log(props)
  }
}
</script>
<style lang="scss" scoped></style> -->

<template>
  <div class="child">
    <h2>child---{{ msg }}</h2>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'
// 数组
// const props = defineProps(['msg'])
const props = defineProps({
  msg: {
    type: String,
    default: '默认值'
  }
})

console.log(props)
</script>

<style lang="scss" scoped></style>
